<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function Father (name) {
      this.name = name;
      this.say = function () {
        console.log('father说话');
      }
    }
    Father.prototype.money = function () {
      console.log(100000);
    };

    function Son (name, age) {
      Father.call(this, name);
      this.age = age;
      this.study = function () {
        console.log('son学习');
      }
    }
    Son.prototype = new Father()
    Son.prototype.constructor = Son


    // 这个是子构造函数专门的方法
    Son.prototype.exam = function () {
      console.log('孩子要考试');
    }

    var son = new Son('张三', 10)
    console.log(son);
  </script>
</body>

</html>